package com.cloudkeeper.leasing.identity.service;

import com.cloudkeeper.leasing.identity.domain.KPIVillageQuota;
import com.cloudkeeper.leasing.base.service.BaseService;
import com.cloudkeeper.leasing.identity.domain.KpiQuota;
import org.springframework.data.repository.query.Param;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 村考核指标 service
 * @author yujian
 */
public interface KPIVillageQuotaService extends BaseService<KPIVillageQuota> {

    void deleteAllByParentDistrictIdAndParentQuotaId(String parentDistrictId,String parentQuotaId);

    List<Map<String, Object>> buildCommonWorkData(String districtId, String taskId, String reviewTaskId, String parentQuotaId, String quarter, String makeQuotaDistrictId);

    List<Map<String, Object>> buildCommonData(String districtId, String taskId, String reviewTaskId, String rootQuotaId, String makeQuotaDistrictId,List<KpiQuota> all1,String taskYear);

    List<Map<String, Object>> buildWatchQuotaData(String districtId, String taskId, String reviewTaskId, String taskYear, String parentQuotaId, String makeQuotaDistrictId,List<KpiQuota> all1);

    List<Map<String, Object>> buildCommentQuotaData(String districtId, String taskId, String reviewTaskId, String taskYear, String parentQuotaId, String makeQuotaDistrictId,List<KpiQuota> a);

    void deleteAllByTownQuotaId(String townQuotaId);

    void deleteAllByTownQuotaIdIn(List<String> townQuotaIds);

    void updateScoreById(@Nonnull String score, @Nonnull String scoreEnd, @Nonnull String id);

    List<KPIVillageQuota> findAllByTownQuotaIdAndQuarter(@Nonnull String townQuotaId, @Nonnull String quarter);
    List<KPIVillageQuota> findAllByTownQuotaIdAndQuarterAndDistrictId(@Nonnull String townQuotaId, @Nonnull String quarter,@Nonnull String districtId);
    List<KPIVillageQuota> findAllByTownQuotaIdAndQuarterAndVillageDistrictId(@Nonnull String townQuotaId, @Nonnull String quarter,@Nonnull String districtId);
    List<KPIVillageQuota> findAllByParentQuotaId(String parentQuotaId);
    Integer updateStateByTownQuotaIdAndParentDistrictId(Collection<String> townQuotaId,String parentDistrictId);
    Integer updateStateByTownQuotaId(Collection<String> townQuotaId);
    void addAll(List<KPIVillageQuota> quotas);
    String exportAll(String[] rowName, List<Object[]> dataList);

    Integer updateRejectListStatus(String parentDistrictId, String year);

    Integer updateScore(String parentDistrictId, String year);

    Integer updateRejectListStatusDepartment(List<String> townQuotaId);
}
